package com.ll.trydemo;

/**
 * @author 刘龙
 * @version 1.0
 */
public class Exception01 {
    public static int method() {
        int i = 1;

        try {
            i++;
            String[] strings = new String[3];
            if (strings[1].equals("ll")) {
                System.out.println(strings[1]);
            } else {
                strings[3] = "ll";
            }
            return 1;
        } catch (ArrayIndexOutOfBoundsException e) {
            return 2;
        } catch (NullPointerException e) {
            return ++i;
        } finally {
             ++i;
            System.out.println("i=" + i);
        }
    }

    public static void main(String[] args) {
        System.out.println(method());
    }
}
